using SqlSugar;

namespace ZhiKeDuoServer.Model
{
    /// <summary>
    /// 
    /// </summary>
    public class OperInfo : ModelContext
    {
        private System.Int32 _Id;
        /// <summary>
        /// 
        /// </summary>
        [SugarColumn(IsIdentity = true)]
        public System.Int32 Id { get { return this._Id; } set { this._Id = value; } }

        private System.String _Code;
        /// <summary>
        /// 
        /// </summary>
        public System.String Code { get { return this._Code; } set { this._Code = value?.Trim(); } }

        private System.String _Pwd;
        /// <summary>
        /// 
        /// </summary>
        public System.String Pwd { get { return this._Pwd; } set { this._Pwd = value?.Trim(); } }

        private System.String _Name;
        /// <summary>
        /// 
        /// </summary>
        public System.String Name { get { return this._Name; } set { this._Name = value?.Trim(); } }

        private System.String _Sex;
        /// <summary>
        /// 
        /// </summary>
        public System.String Sex { get { return this._Sex; } set { this._Sex = value?.Trim(); } }

        private System.String _CId;
        /// <summary>
        /// 
        /// </summary>
        public System.String CId { get { return this._CId; } set { this._CId = value?.Trim(); } }

        private System.String _Phone;
        /// <summary>
        /// 
        /// </summary>
        public System.String Phone { get { return this._Phone; } set { this._Phone = value?.Trim(); } }

        private System.Int32 _Role;
        /// <summary>
        /// 
        /// </summary>
        public System.Int32 Role { get { return this._Role; } set { this._Role = value; } }

        [SugarColumn(IsIgnore = true)]
        public string RoleName { get { return this.RoleSingle.Name; } }

        [SugarColumn(IsIgnore = true)]
        public Role RoleSingle
        {
            get
            {
                var a= base.CreateMapping<ZhiKeDuoServer.Model.Role>().Single(it => it.Id == this.Role);
                return a;
            }
        }
    }
}